#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
struct node
{
    int val, left, right;
}tree[40];
int end1;
void dfs(int pos)
{
    int left = pos * 2;
    int right = pos * 2 + 1;
    if (left <= end1)
    {
        dfs(left);
        tree[pos].left = left;
    }
    if (right <= end1)
    {
        dfs(right);
        tree[pos].right = right;
    }
    cin >> tree[pos].val;
}
int main()
{
    int n;
    cin >> n;
    end1 = n;

    for (int i = 1; i <= n; i++)
    {
        if (i != 1)cout << " ";
        else cout << tree[i].val;
    }
    return 0;
}